﻿using System;
using System.Collections.Generic;
using System.Text;
using Quartz;
using AppToolKit.Core.Context.Spring;
 
using Common.Logging;
using Utility;
using BLL.Action.Core.State;
using BLL.Action.Core.Base;

namespace BLL.Action.Job
{
   public class SystemJob : IJob
    {

        #region IJob Members
        public ContextAware ContextAwareHolder { get; set; }
        private StateMonitor Monitor_;
        ILog log = LogManager.GetLogger(LogDefault.AppDebug);
        public void Execute(JobExecutionContext context)
        {
            ContextAwareHolder = context.JobDetail.JobDataMap.Get(JobBase.ContextAware_Filed) as ContextAware;
            log.Debug(string.Format("job:{0}", context.JobDetail.Name));
            Monitor_ = new StateMonitor();
            ContextAwareHolder.AutowireObject(Monitor_);

            Monitor_.RunMonitor();

        }

        #endregion
    }
}
